package persistent.prestige.console.netty.dubbo.net;

import java.io.Serializable;

/**
 * 响应数据包
 * @author dingwei2
 *
 */
public class Response implements Serializable {
	
	//请求号
	private int requestId;
	
	//0:成功;1:失败(非0为失败)
	private short code;
	
	// json 数据格式
	private String data;
	
	public Response() {}

	public Response(int requestId, short code, String data) {
		super();
		this.requestId = requestId;
		this.code = code;
		this.data = data;
	}

	public int getRequestId() {
		return requestId;
	}

	public void setRequestId(int requestId) {
		this.requestId = requestId;
	}

	public short getCode() {
		return code;
	}

	public void setCode(short code) {
		this.code = code;
	}

	public String getData() {
		return data == null ? "" : data;
	}

	public void setData(String data) {
		this.data = data;
	}


}
